home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / telcom / ccitt / v42bis.asc < prev   
Text File  |  1993-07-14  |  63KB  |  1,945 lines

  1.  
  2.  
  3.                                               FOREWORD
  4.                The  CCITT  (the  International  Telegraph   and   Telephone   Consultative
  5.          Committee) is the  permanent organ of the International  Telecommunication  Union
  6.          (ITU).  CCITT  is  responsible  for  studying  technical,  operating  and  tariff
  7.          questions and issuing recommendations  on  them  with  a  view  to  standardizing
  8.          telecommunications on a worldwide basis.
  9.                The Plenary Assembly of CCITT which meets  every  four  years,  establishes
  10.          the topics for study and approves Recommendations prepared by its  Study  Groups.
  11.          The  approval  of  Recommendations  by  the  members  of  CCITT  between  Plenary
  12.          Assemblies is covered by the procedure  laid  down  in  CCITT  Resolution  No.  2
  13.          (Melbourne, 1988).
  14.                Recommendation V.42 bis was prepared by Study Group XVII and  was  approved
  15.          under the Resolution No. 2 procedure on the 31st of January 1990.
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.                                             F  ITU  1990
  37.          All rights reserved. No part of this publication may be reproduced or utilized in
  38.          any form or by any means, electronic or mechanical,  including  photocopying  and
  39.          microfilm, without permission in writing from the ITU.
  40.          Recommendation V.42 bis
  41.                        DATA  COMPRESSION  PROCEDURES  FOR  DATA  CIRCUIT  TERMINATING
  42.                            EQUIPMENT  (DCE)  USING  ERROR  CORRECTING  PROCEDURES
  43.                The CCITT,
  44.          considering
  45.                (a) that the use of V-Series DCEs for transmission of asynchronous data  on
  46.          the general switched telephone network (GSTN) is widespread;
  47.                (b) that  Recommendation  V.42  [1]  defines  error  correction  procedures
  48.          providing improved error performance;
  49.                (c)  that  improved  throughput  is  possible  through  the  use  of   data
  50.          compression procedures;
  51.                (d) that there is  a  need  to  interwork  with  DCEs  not  providing  data
  52.          compression;
  53.          declares the view
  54.                that the data compression procedures to  be  followed  by  DCEs  using  the
  55.          error correcting procedures defined in Recommendation V.42  be  as  specified  in
  56.          this Recommendation.
  57.          1      Scope
  58.          1.1    General
  59.                This Recommendation describes a data compression procedure for use wi h  V-
  60.          Series DCEs.
  61.                The principal characteristics of the data compression procedure are:
  62.                a)  a compression procedure based on an algorithm which encodes strings of
  63.                   characters received from data terminal equipment (DTE)
  64.                b)  a decoding procedure which recovers the  strings  of  characters  from
  65.                   received codewords;
  66.                c)  an automatic transparent mode of operation when uncompressible data is
  67.                   detected.
  68.                An exploration of the parameters used in this Recommendation  is  given  in
  69.          S 10.
  70.          1.2    Requirements for error correcting procedures
  71.  
  72.                                                            Recommendation V.42 bis   PAGE7
  73.                For correct operation of the data  compression  function  it  is  necessary
  74.          that an error correcting procedure be implemented between the two entities  using
  75.          this Recommendation. In the case of V-series Recommendations, this requires  that
  76.          the LAPM (link access procedure for modems) error correcting  procedures  defined
  77.          in Recommendation V.42 or the error correcting procedures in Recommendation V.120
  78.          [2] be implemented.
  79.                Note  -  Undetected  bit  errors  will  cause  misoperation  of  the   data
  80.          compression function. Use of a 32-bit frame check sequence (FCS)  as  defined  in
  81.          ISO 3309 [3] substantially  reduces  the  possibility  of  such  errors.  It  may
  82.          therefore be desirable to use this 32-bit FCS (which is an option in  V.42  LAPM)
  83.          in environments with severe impairments.
  84.          1.3    A DCE employing data compression
  85.                The data compression function may be used with an error-correcting DCE,  as
  86.          shown in Figure 1/V.42 bis. The elements of an error correcting V-series DCE  are
  87.          specified in Recommendation V.42.
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.          PAGE6   Recommendation V.42 bis
  145.  
  146.                                               FIGURE 1/V.42 bis
  147.                               DCE employing data compression and error control
  148.          2      Definitions
  149.          2.1    character
  150.                Single data element, encoded using a predefined number of bits (N3 = 8).
  151.          2.2    start-stop or asynchronous format
  152.                Start-stop or asynchronous format is defined  in  Recommendations  V.7  [4]
  153.          and V.14 [5].
  154.          2.3    ordinal value
  155.                The ordinal value of a character is the numerical equivalent of the  binary
  156.          encoding of the character.  For  example,  the  character  "A"  when  encoded  as
  157.          01000001 would have an ordinal value of 6510.
  158.          2.4    alphabet
  159.                Set of all possible characters which may be sent  or  received  across  the
  160.          DTE/DCE interface. It is assumed in this Recommendation that the  ordinal  values
  161.          of the alphabet are contiguous from 0 to N4 -  1,  where  N4  is  the  number  of
  162.          characters.
  163.          2.5    codeword
  164.                A codeword, within the context of this Recommendation, is a  binary  number
  165.          in the range 0 to N2 - 1 which represents a string of  characters  in  compressed
  166.          form. A codeword is encoded using a number of bits C2, where C2  is  initially  9
  167.          (i.e. N3 + 1) and increases to a maximum of N1 bits (see S 7).
  168.          2.6    control codeword
  169.                A control codeword is reserved for use in DCE-to-DCE signalling of  control
  170.          information related to the compression function whilst in the compressed mode  of
  171.          operation (see S 9).
  172.          2.7    command code
  173.                Octet which is  used  for  DCE-to-DCE  signalling  of  control  information
  174.          related to the compression function whilst in the transparent mode of  operation.
  175.          Command codes are distinguished from normal  characters  by  a  preceding  escape
  176.          character (see S 2.13).
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.                                                            Recommendation V.42 bis   PAGE7
  217.                2.8    tree structure
  218.                Abstract data structure which is used in this Recommendation  to  represent
  219.          a set of strings with the same initial  character  (see  Figure  2/V.42  bis  and
  220.          S 6.1).
  221.          2.9    leaf node
  222.                Point  on  a  tree  which  represents,   within   the   context   of   this
  223.          Recommendation, the last character in a string (see S 6.1).
  224.          2.10   root node
  225.                A root node is a point on a tree which represents, within  the  context  of
  226.          this Recommendation, the first character in a string (see Figure 2/V.42  bis  and
  227.          S 6.1).
  228.          2.11   compressed operation
  229.                Compressed operation has two modes. Transitions between the  modes  may  be
  230.          automatic based on the content of the data received from the DTE (see S 7.1).
  231.          2.11.1 compressed mode
  232.                A mode  of  operation  in  which  data  from  the  DTE  is  transmitted  in
  233.          codewords.
  234.          2.11.2 transparent mode
  235.                A mode of operation in which compression has  been  selected  but  data  is
  236.          being transmitted in uncompressed form. Transparent mode command  code  sequences
  237.          may be inserted into the data stream.
  238.          2.12   uncompressed operation
  239.                A mode of operation in which compression has not been  selected.  The  data
  240.          compression function is inactive.
  241.          2.13   escape character
  242.                Within the context of  this  Recommendation,  the  escape  character  is  a
  243.          character which, in transparent mode, indicates the beginning of a  command  code
  244.          sequence. This has an initial value of zero, and is adjusted on  each  appearance
  245.          of the escape character in the data stream from the DTE, whether  in  transparent
  246.          mode or compressed mode (see S 9.2).
  247.          3      Abbreviations
  248.                The abbreviations introduced in this Recommendation are:
  249.                EID     Escape in Data, a command code defined in S 9.
  250.                ETM Enter Transparent Mode, a control codeword defined in S 9.
  251.                ECM Enter Compressed Mode, a command code defined in S 9.
  252.          4      Overview of the operation of a DCE incorporating a data compression 
  253.                function
  254.          4.1    General
  255.                A DCE employing  data  compression,  as  depicted  in  Figure  1/V.42  bis,
  256.          contains the following components:
  257.                a)  DTE/DCE interchange circuits;
  258.                b)  a signal converter;
  259.                c)  a control function;
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.          PAGE6   Recommendation V.42 bis
  289.                  d)  an error control function; and
  290.                  e)  a data compression function.
  291.                 The control  function  shall  have  additional  capabilities  beyond  those
  292.           needed for an error correcting DCE  as  described  in  Recommendation  V.42.  The
  293.           additional capabilities of the control function are described in  S  5,  and  the
  294.           operation of the data compression function  is  described  in  SS  6  to  9.  The
  295.           remainder of this section provides an overview of the control function  and  data
  296.           compression function.
  297.           4.2    Overview of the control function
  298.                 The control function shall perform, in addition to  the  functions  defined
  299.           in S 6.2 of Recommendation V.42, the following aspects of operation;
  300.                  a)  negotiation of the presence of the data compression  function  in  the
  301.                      remote DCE, and of parameters associated with the operation of the data
  302.                      compression function;
  303.                  b)  initialization or re-initialization of the data compression function;
  304.                  c)  coordination of the establishment of an error controlled connection for 
  305.                      use by the peer data compression functions;
  306.                  d)  coordination of the delivery of data between the DTE/DCE interface and
  307.                      the data  compression  function,  in  accordance  with  the  procedures
  308.                      defined in Recommendation V.42, SS 6.2 and 8.4, including the provision
  309.                      of the flow control procedures defined therein;
  310.                  e)  coordination of the delivery of  data  between  the  data  compression
  311.                      function and the error control function;
  312.                  f)  action on detection of an exception condition.
  313.           4.3    Overview of the data compression function
  314.                 The data compression function shall implement  the  procedures  defined  in
  315.           this Recommendation, which result in the efficient  encoding  of  data  prior  to
  316.           transmission over the error controlled connection, and shall have  the  following
  317.           capabilities:
  318.                  a)  initialization of the data compression function;
  319.                  b)  data compression encoding and decoding;
  320.                  c)  a mechanism for switching between compressed and transparent modes  of
  321.                      operation.
  322.           4.4    Communication between  the  control  function  and  the  data  compression
  323.                  function
  324.                 Communication  between  the  control  function  and  the  data  compression
  325.           function is modelled as a set of abstract  primitives  of  the  form  X-NAME-TYPE
  326.           which represent the logical exchange of information and control to  accomplish  a
  327.           task or service. In the context of this Recommendation the  control  function  is
  328.           viewed as the "service user" while the data compression function is viewed as the
  329.           "service provider". The types of primitive are request, indication, response  and
  330.           confirm.
  331.                 The services expected by the control function are  shown  in  Table  1/V.42
  332.           bis.
  333.           5      Operation of the control function
  334.           5.1    Negotiation of the data compression function
  335.                 The use of the data compression  function  and  the  associated  parameters
  336.           shall be negotiated at link establishment via a protocol (for example, using  the
  337.           XID procedure defined  in  Recommendation  V.42),  following  which  they  remain
  338.           unchanged for the duration of the error corrected connection.
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.                                                             Recommendation V.42 bis   PAGE7
  361.                                               TABLE 1/V.42 bis
  362.                                   Services expected by the control function
  363.  
  364.                              Service                        Primitive         S
  365.          Initialize the data compression function         C-INIT          5.2, 5.6
  366.          Indicate an error to the control function        C-ERROR            5.8
  367.          Transfer uncompressed data to/from the data      C-DATA             5.4
  368.          compression function                             
  369.          Transfer compressed data to/from the data        C-TRANSFER         5.5
  370.          compression function                             
  371.          Flush remaining untransmitted data from          C-FLUSH            5.7
  372.          the encoder                                      
  373.  
  374.  
  375.                Parameter P0 specifies whether or not  compression  is  to  be  used.  This
  376.          parameter also specifies the directions (transmit only,  receive  only,  or  both
  377.          directions). The default value of P0 is 0, indicating no  compression  in  either
  378.          direction. If compression is proposed for only one direction, then the only valid
  379.          response is for the proposed direction  or  no  compression.  If  compression  is
  380.          proposed for both directions, then valid responses are for both  directions,  for
  381.          either single direction, or for no compression.
  382.                Parameter P1 represents  a  proposed  value  of  N2  the  total  number  of
  383.          codewords. P1 shall have a default value of 512, which is its  minimum  value;  a
  384.          maximum value is not specified within this Recommendation. Any attempt to specify
  385.          less than the minimum value shall be considered a procedural error and result  in
  386.          disconnection. When values of P1 a exchanged during the negotiation procedure  in
  387.          one or both directions of transmission, the lower value shall   be  selected  and
  388.          assigned to N2 in both DCEs.
  389.                Note - See Appendix II for guidance on the choice of value of N2,  and  its
  390.          effect on performance.
  391.                Parameter P2 is the proposed value for N7, the maximum string  length.  The
  392.          default value of P2 is 6, and the permitted range is from 6 to  250.  The  values
  393.          outside this range are invalid; and attempt  to  specify  such  values  shall  be
  394.          regarded as a procedural error and result in disconnection. When values of P2 are
  395.          exchanged during the negotiation procedure, the lower value shall be selected and
  396.          assigned to N7 in both DCEs.
  397.          5.2    Initialization of the data compression function
  398.                Following  successful  negotiation  of  data  compression  parameters,  the
  399.          control function shall issue the C-INIT request primitive to the data compression
  400.          function. The primitive shall indicate the values of the negotiated parameters.
  401.          5.3    Connection establishment
  402.                On receipt of the  C-INIT  confirm  primitive  from  the  data  compression
  403.          function, the control function shall indicate to the DTE that data  transfer  may
  404.          commence.
  405.          data 
  406.                data compression function
  407.                On completion of  connection  establishment,  the  control  function  shall
  408.          request encoding of the data received on the DTE/DCE interface.
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.          PAGE6   Recommendation V.42 bis
  433.                To  encode  data,  the  control  function  shall  issue  a  C-DATA  request
  434.          primitive to the data compression function. This  primitive  shall  indicate  the
  435.          data to be encoded.
  436.                On receipt of a C-DATA  indication  primitive  from  the  data  compression
  437.          function, the control function shall deliver the  decoded  data  to  the  DTE/DCE
  438.          interface.
  439.                Flow control procedures will be necessary in order to avoid potential  loss
  440.          of  data  due  to  buffer  overflow.  When  the  procedures   defined   in   this
  441.          Recommendation are used in conjunction with those defined in Recommendation V.42,
  442.          the flow control procedures defined in Recommendation V.42, SS 7.3.1  and  8.4.2,
  443.          shall be applied.
  444.          5.5    Coordination of the transfer of data between the data compression function
  445.                and error control function
  446.                On receipt of a C-TRANSFER indication primitive from the  data  compression
  447.          function, the control function shall issue an L-DATA  request  primitive  to  the
  448.          error control function.
  449.                On receipt of  an  L-DATA  indication  primitive  from  the  error  control
  450.          function, the control function shall issue a C-TRANSFER request primitive to  the
  451.          data compression function.
  452.          5.6    Reinitialization of the data compression function
  453.                The control function shall issue a C-INIT request to the  data  compression
  454.          function on the following conditions:
  455.                a)  L-ESTABLISH indication or confirm;
  456.                b)  L-SIGNAL indication  or  confirm,  where  the  primitive  indicates  a
  457.                   destructive form.
  458.                It is the responsibility of the control functions  to  ensure  that  C-INIT
  459.          request primitives are issued only when no data is in transit  between  the  data
  460.          compression  functions  (e.g.  in  the  error  control   functions)   to   ensure
  461.          synchronization between the encoders and decoders.
  462.          5.7    Expedited data transfer
  463.                Certain conditions, the specification of which  is  outside  the  scope  of
  464.          this Recommendation, may arise which require that any partially encoded  data  is
  465.          transferred immediately, for example if the error control function is in an  idle
  466.          condition. If such a condition arises, the control function shall issue a C-FLUSH
  467.          request primitive to the data  compression  function,  and  shall  then  transfer
  468.          remaining data in accordance with S 5.5.
  469.          5.8    Action on detection of C-ERROR
  470.                The C-ERROR indication is used to  inform  the  control  function  that  an
  471.          error (for example, a procedural error  or  loss  of  synchronization)  has  been
  472.          detected by the data  compression  function.  The  control  function  shall  take
  473.          appropriate recovery action, including re-establishment of  the  error  corrected
  474.          connection.
  475.                The  following  conditions  recognized  by  the  decoder  result   in   the
  476.          generation of a C-ERROR indication primitive:
  477.                a)  receipt of a STEPUP codeword when it would cause the value  of  C2  to
  478.                   exceed N1;
  479.                b)  receipt of a codeword, at any time, equal to C1;
  480.                c)  receipt of a codeword representing an empty dictionary entry;
  481.                d)  receipt of a reserved command code.
  482.          6      Procedures for dictionary use and maintenance
  483.          6.1    General
  484.                The data compression function employs an algorithm in  which  a  string  of
  485.          characters read from the DTE is encoded as a fixed length codeword.  The  process
  486.          employs dictionaries, in which the strings are stored, and which are  dynamically
  487.          updated during normal operation.
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.                                                            Recommendation V.42 bis   PAGE7
  505.                The data compression function contains two dictionaries, one maintained  by
  506.          the data compression encoder for use in compression of  data  received  from  the
  507.          DTE, and one maintained by the data compression decoder for use in  the  decoding
  508.          of data received from the error control function.
  509.                The dictionary functions are:
  510.                a)  string matching, in which a sequence of characters is  read  from  the
  511.                   DTE, and the dictionary searched for the resulting string (see S 6.3);
  512.                b)  updating, in which a new string is added to the dictionary (see S 6.4);
  513.                c)  the deletion of  infrequently  used  strings  in  order  that  storage
  514.                   capacity may be reused (S 6.5).
  515.                The dictionary used to store strings for use in the encoding  and  decoding
  516.          process may be logically  represented  using  an  abstract  data  structure.  The
  517.          dictionary can be considered to contain a set of trees, as shown in Figure 2/V.42
  518.          bis, each with a root corresponding to a character in the alphabet. Wi h  the  8-
  519.          bit character format there will be 256 trees.
  520.                A tree represents the set of known  strings  beginning  with  one  specific
  521.          character, and each node or point in the tree  represents  one  of  this  set  of
  522.          strings. The trees in Figure 2/V.42 bis represent the strings A, B, BA, BAG, BAR,
  523.          BAT, BI, BIN, C, D, DE, DO and DOG.
  524.                A node that has no  dependant  nodes,  represented  by  the  hierarchically
  525.          lower level in the tree, is  a  leaf  node.  A  leaf  node  represents  the  last
  526.          character in a string.
  527.                A node that has no parent, represented by the hierarchically  higher  level
  528.          in the tree, is a root node. A root node represents  the  first  character  in  a
  529.          string.
  530.                Associated with each node is a  codeword  used  to  uniquely  identify  the
  531.          node. The assignment of  codewords  within  the  encoder  dictionary  of  a  data
  532.          compression function, and the corresponding assignment of  codewords  within  the
  533.          decoder dictionary of the peer data compression function in the  remote  DCE  are
  534.          equivalent, and the codeword thus provides a reversible encoding of a string.
  535.          6.2    Dictionary initialization procedure
  536.                On receipt of a C-INIT request primitive from  the  control  function,  the
  537.          data compression function shall reset the encoder and decoder dictionaries to the
  538.          initial condition.
  539.                In the initial condition, each tree in the dictionary  shall  consist  only
  540.          of a root node. The codeword associated with each root  node  shall  be  N6  (the
  541.          number of control codewords) plus the ordinal value of the character  represented
  542.          by the node. The counter C1, used in the allocation of new  nodes  (see  S  6.5),
  543.          shall be set to N5.
  544.          6.3    String matching procedure
  545.                This procedure has the  function  of  matching  a  sequence  of  characters
  546.          (string) with a dictionary entry. The procedure  shall  commence  with  a  single
  547.          character representing the first character in the string. The following steps are
  548.          then applied:
  549.                a)  a string shall be formed from the first character;
  550.                b)  if the string matches a dictionary entry, and the entry  is  not  that
  551.                   entry created by the last invocation of the string matching  procedure,
  552.                   then the next character shall be read and appended to  the  string  and
  553.                   this step repeated;
  554.                c)  If the string does not match a dictionary entry or matches  the  entry
  555.                   created by the last invocation of the string  matching  procedure,  the
  556.                   last character appended to the string shall be removed. The string thus
  557.                   shortened represents the longest matched string and the last  character
  558.                   represents the unmatched character.
  559.                This procedure will  normally  match  the  longest  string  of  characters.
  560.          However, there are two cases in which  step  b)  shall  be  terminated  before  a
  561.          longest match is found:
  562.                i)  if an exception condition occurs such as a C-INIT request primitive or
  563.                   C-FLUSH request primitive (while in compressed mode only);
  564.                ii) when a transition between transparent and compressed modes of operation 
  565.                   occurs.
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.          PAGE6   Recommendation V.42 bis
  577.  
  578.                                               FIGURE 2/V.42 bis
  579.                                  Tree based representation of the dictionary
  580.                When in transparent mode the encoder shall use only the criteria  specified
  581.          above for terminating the string matching procedure.  When  in  compressed  mode,
  582.          however, the encoder may employ other  criteria  for  terminating  the  procedure
  583.          (e.g. a timeout).
  584.                If the string matching procedure is terminated before a  longest  match  is
  585.          found, the next character from the DTE shall be considered to be  the  "unmatched
  586.          character" for the purposes of updating the dictionary and restarting the  string
  587.          matching procedure.
  588.          6.4    Procedure for adding strings to the dictionary
  589.                In order to maintain efficient compression, the dictionary  is  adapted  by
  590.          the addition of new strings. A new string shall be formed by appending  a  single
  591.          character to an existing string, thereby adding a  new  node  onto  a  tree.  The
  592.          single character shall be the  unmatched  character  resulting  from  the  string
  593.          matching operation, or the prefix character resulting from  the  string  decoding
  594.          operation. Following this procedure, the single character required to restart the
  595.          string matching procedure will be the unmatched character.
  596.                There are two conditions under which a new string shall not be added:
  597.                a)  if this would result in the maximum string length, N7, being exceeded;
  598.                b)  if the string is already in the dictionary.
  599.                Immediately after the creation of a dictionary  entry,  the  procedure  for
  600.          recovering a dictionary entry shall be applied.
  601.          6.5    Procedure for recovering a dictionary entry
  602.                This section defines  a  systematic  procedure  for  recovering  dictionary
  603.          entries for re-use when all available entries have been  filled.  When  the  last
  604.          available dictionary entry has been assigned, this procedure  recovers  a  single
  605.          entry, maintaining the association between the empty entry and its codeword.
  606.                A counter  C1  indicates  the  codeword  associated  with  the  next  empty
  607.          dictionary entry, and is maintained in the range N5 to N2 - 1. Counter  C1  shall
  608.          be set to N5 initially.
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.                                                            Recommendation V.42 bis   PAGE7
  649.                The procedure shall be applied only after the creation of a new  dictionary
  650.          entry, and shall consist of the following steps:
  651.                a)  counter C1 shall be incremented;
  652.                b)  if the value of C1 exceeds N2 - 1 then C1 shall be set to N5;
  653.                c)  if the node identified by the codeword with value C1 is in use and not
  654.                   a leaf node, then go to step a);
  655.                d)  if the node is a leaf node, then it shall be detached from its parent.
  656.          7      Operation of the encoding function
  657.          7.1    General
  658.                The encoding function has five principal operations:
  659.                a)  string matching, in which a sequence of characters  from  the  DTE  is
  660.                   matched with a dictionary entry (see S 7.3);
  661.                b)  encoding, in which the codeword of the  matched  dictionary  entry  is
  662.                   represented as a binary value of length C2 bits (see S 7.4);
  663.                c)  transfer, in which either the codeword(s) in compressed  mode  or  the
  664.                   characters in transparent mode are passed to the control function  (see
  665.                   S 7.5);
  666.                d)  dictionary updating, in which a new dictionary entry is created, using
  667.                   the matched dictionary entry and the unmatched character (see S 7.6);
  668.                e)  nod recovery, in which a dictionary entry is recovered for use in  the
  669.                   next dictionary update (see S 7.7).
  670.                The encoding function operates in one of two modes,  transparent  mode  and
  671.          compressed mode, switching between these modes on the basis of the  test  applied
  672.          in f) below. The sequence of operations, and the cycling of the escape  character
  673.          (see S 9) are identical in the two modes of operation.
  674.                The encoder shall support two further operations, which  shall  be  applied
  675.          only during the string matching procedure in accordance with S 6.3:
  676.                f)  data compressibility testing, in which the efficiency of the  encoding
  677.                   process is estimated and transparent mode or compressed  mode  selected
  678.                   to maximize efficiency (see S 7.8);
  679.                g)  flush, in which a C-FLUSH request from the control function  indicates
  680.                   that all outstanding data shall be sent (see S 7.9).
  681.          7.2    Initial conditions
  682.                On receipt  of  a  C-INIT  request  the  data  compression  function  shall
  683.          initialize the encoder to the following state:
  684.                a)  the dictionary shall be set to  the  initial  condition  described  in
  685.                   S 6.2;
  686.                b)  the codeword size C2 shall be set to N3 + 1;
  687.                c)  the threshold C3 shall be set to N4 X 2;
  688.                d)  the function shall be set to transparent mode;
  689.                e)  the escape character shall be assigned the ordinal value 0.
  690.          7.3    String matching
  691.                On receipt of a C-DATA request the data compression  function  shall  apply
  692.          the string matching procedure defined in S 6.3. The  initial  character  required
  693.          shall be the unmatched character resulting from the  most  recent  invocation  of
  694.          this procedure.
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.          PAGE6   Recommendation V.42 bis
  721.                7.4    Encoding
  722.                This procedure is used when  in  the  compressed  mode  of  operation.  Its
  723.          purposes is to represent the codeword as a sequence of C2  bits;  the  order  and
  724.          numbering of the bits is shown in Figure 3/V.42 bis.
  725.                If  the  codeword  corresponding  to  the  matched  dictionary   entry   is
  726.          numerically equal to or greater than the threshold C3 then:
  727.                a)  the STEPUP control codeword shall be encoded and transferred using the
  728.                   current codeword size (C2);
  729.                b)  the codeword size C2, shall be increased by 1;
  730.                c)  multiply C3 by 2;
  731.                d)  if the codeword is still numerically greater than or equal to C3, steps 
  732.                   a) to c) shall be repeated.
  733.                The codeword is then transferred to the  control  function,  in  accordance
  734.          with the procedures defined in S 7.5.
  735.  
  736.                                               FIGURE 3/V.42 bis
  737.                                       Mapping of codewords into octets
  738.          7.5    Transfer
  739.                In transparent mode, characters shall be passed  to  the  control  function
  740.          for transmission in octet aligned form, using a C-TRANSFER indication.  They  may
  741.          be transferred individually  during  the  string  matching  procedure,  or  as  a
  742.          sequence following completion of the string matching procedure.
  743.                In compressed mode, the matched string shall be encoded  according  to  the
  744.          procedure defined in S 7.4 and passed to the control  function  in  packed  form,
  745.          with the least significant bit of  a  codeword  immediately  following  the  most
  746.          significant bit of the preceding codeword.
  747.                When the encoder changes state from transparent  to  compressed  mode,  the
  748.          least significant bit of the first codeword to be transferred shall be bit  1  of
  749.          the next octet position.
  750.                Following transfer of  a  FLUSH  control  codeword,  or  when  the  encoder
  751.          changes state from compressed to transparent mode following transfer of  the  ETM
  752.          control codeword  (see  S  9)  in  the  sequence,  sufficient  0  bits  shall  be
  753.          transmitted to ensure that the next transmitted character is octet aligned.
  754.                Figure 3/V.42 bis provides an example of the  data  stream  passed  to  the
  755.          error control function during a transition from compressed to  transparent  mode.
  756.          Two 11-bit codewords A and B are transmitted in compressed  form  followed  by  a
  757.          transition  to  transparent  mode.  In  this  example,  the  transition  requires
  758.          insertion of seven 0 bits in order that the first uncompressed character, C  sent
  759.          in transparent mode, is octet aligned.
  760.          7.6    Dictionary updating
  761.                A  new  dictionary  node  shall  be  created  from  the  match  string  and
  762.          corresponding unmatched character returned  by  the  string  matching  procedure,
  763.          using the procedures defined in S 6.4.
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.                                                            Recommendation V.42 bis   PAGE7
  793.                7.7    Node recovery
  794.                Following the  creation  of  a  new  dictionary  node,  the  node  recovery
  795.          procedure defined in S 6.5 shall be applied.
  796.          7.8    Data compressibility test
  797.                The data compression function shall periodically apply a test to  determine
  798.          the compressibility of the data. The nature of the test is not specified in  this
  799.          Recommendation; however it would consist of a comparison of the  number  of  bits
  800.          required to represent a segment of the data stream before and after compression.
  801.          7.8.1  Transition to compressed mode
  802.                If the data compression function is in the transparent mode and  determines
  803.          that data compression would be effective, it shall:
  804.                a)  perform the dictionary update procedure using the current  accumulated
  805.                   string and the next character to be processed by  the  string  matching
  806.                   procedure (which will be the first character of the string  represented
  807.                   by the first codeword transmitted in compressed mode);
  808.                b)  indicate to the peer data compression function that  a  transition  to
  809.                   compressed mode is required, using the  ECM  transparent  mode  command
  810.                   sequence (see S 9.1);
  811.                c)  enter compressed mode.
  812.          7.8.2  Transition to transparent mode
  813.                If the data compression function is in the compressed mode  and  determines
  814.          that the data stream is currently not compressible, it shall:
  815.                a)  ensure that the codeword representing any partially encoded  data  has
  816.                   been transferred in accordance with the procedure given in SS  7.4  and
  817.                   7.5;
  818.                b)  perform the dictionary update procedure using the current  accumulated
  819.                   string and the next character to be processed by  the  string  matching
  820.                   procedure (which will be the first character transmitted in transparent
  821.                   mode);
  822.                c)  indicate to the peer data compression function by transferring the ETM
  823.                   control codeword (see S 9) a transition to transparent mode;
  824.                d)  transmit sufficient 0 bits to recover octet alignment (see S 7.5);
  825.                e)  change the state to transparent mode.
  826.          7.8.3  RESET function
  827.                In transparent mode the RESET command code may be used to indicate  to  the
  828.          peer data compression function  that  the  encoder  dictionary  is  about  to  be
  829.          re-initialized according to the procedures given in SS 6.2  and  7.2.  The  RESET
  830.          command code is sent using the escape character  value  before  re-initialization
  831.          takes place.
  832.                The circumstances under which the encoder requests a dictionary  reset  are
  833.          not defined in this Recommendation, but would generally result from  the  encoder
  834.          determining that some improvement in performance would result from resetting  the
  835.          dictionary. The procedures for requesting re-initialization of the dictionary  on
  836.          link establishment,  or  on  detection  by  the  control  function  of  an  error
  837.          condition, are defined in SS 5.2 and 5.6.
  838.                The RESET command code is not sent  when  a  C-INIT  request  primitive  is
  839.          received from the control function.
  840.          7.9    Action on receipt of C-FLUSH request
  841.                Upon receipt of a  C-FLUSH  request  from  the  control  function,  if  the
  842.          encoder is in compressed mode and  there  is  a  partially-matched  string  being
  843.          processed, the data compression function shall:
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.          PAGE6   Recommendation V.42 bis
  865.                      a)  ensure that the codeword representing any partially-matched string is 
  866.                      transferred in accordance with the procedures defined  in  SS  7.4  and
  867.                      7.5;
  868.                  b)  perform the dictionary update procedure using the current  accumulated
  869.                      string and, when available, the next character to be processed  by  the
  870.                      string matching procedure;
  871.                  c)  if step a) leaves extra bits pending for transmission (octet alignment
  872.                      not yet achieved), then:
  873.                      i)  transfer the FLUSH codeword (see S 9);
  874.                      ii) if necessary, transfer sufficient 0 bits to recover octet alignment
  875.                         (see S 7.5).
  876.                 If the encoder is in transparent mode, on  receipt  of  a  C-FLUSH  request
  877.           from the control function, the  data  compression  function  shall  transfer  all
  878.           outstanding data; the string  matching  procedure  is  not  terminated,  and  the
  879.           dictionary update procedure is not performed.
  880.           8      Operation of the decoding function
  881.                 The decoding function shall be capable of operation in both compressed  and
  882.           transparent modes, and shall operate in a manner consistent with that defined  in
  883.           SS 6, 7 and 9.
  884.                 On receipt of a C-INIT  request  from  the  control  function  or  a  RESET
  885.           command code from the  peer  data  compression  function,  the  data  compression
  886.           function shall initialize the decoding function in accordance with the procedures
  887.           defined in SS 6.2 and 7.2.
  888.                 In transparent mode, the decoding function shall apply the string  matching
  889.           procedure given in S 6.3, in order that the decoder dictionary may be  maintained
  890.           in a compatible state to the peer (remote) encoder dictionary. On receipt of  the
  891.           ECM or EID command  code,  the  decoding  function  shall  operate  in  a  manner
  892.           consistent with  the  encoder  operations  defined  in  SS  7.8.1  and  9.2.  New
  893.           dictionary entries shall be created in a manner consistent  with  the  procedures
  894.           defined in SS 6.4 and 7.3.
  895.                 In  compressed  mode  the  decoding  function  shall  recover  the  encoded
  896.           strings. On receipt of the ETM or FLUSH codewords the decoder shall operate in  a
  897.           manner consistent with the encoder operations defined in SS 7.8.2  and  7.9.  New
  898.           dictionary entries shall be created using the procedure defined in  S  6.4,  with
  899.           the first (prefix) character of the most recently decoded string  being  appended
  900.           to the previous decoded string.
  901.                 The decoder shall regard the STEPUP control codeword as an indication  that
  902.           the encoder has increased the codeword size in  accordance  with  the  procedures
  903.           defined in S 7.4.
  904.           9      Communications between peer data compression functions
  905.           9.1    Control codewords and command codes
  906.                 The  control  codewords  and  command  codes  allocated  for  communication
  907.           between peer data compression functions are given in Table 2/V.42 bis.
  908.           9.2    Procedures for use of the escape sequence
  909.                 A transparent mode command sequence shall consist of the  escape  character
  910.           followed by one of the command codes listed in S 9.1 above.
  911.                 To reduce data  expansion  resulting  from  the  escape  mechanism  defined
  912.           below, if the current escape character is detected within the  data  stream  from
  913.           the DTE, the data compression function shall:
  914.                  a)  if in transparent mode, transfer the detected  escape  character,  and
  915.                      transmit the EID code, and then
  916.                  b)  in both transparent and compressed modes,  modify  the  value  of  the
  917.                      escape character by adding to it the decimal value 51, the addition  to
  918.                      be performed modulo 256.
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.                                                             Recommendation V.42 bis   PAGE7
  937.                                               TABLE 2/V.42 bis
  938.  
  939.                            Control code words (used in compressed mode)
  940.            Code word              Name                           Description
  941.                0      ETM                          Enter transparent mode
  942.                1      FLUSH                        Flush data
  943.                2      STEPUP                       Step up codeword size
  944.                              Command codes (used in transparent mode)
  945.              Value                Name                           Description
  946.                0      ECM                          Enter compression mode
  947.                1      EID                          Escape character in data
  948.                2      RESET                        Force reinitialization
  949.            3 to 255   Reserved                     
  950.  
  951.          10     Parameters
  952.                The following parameters are required by the data compression function.  N1
  953.          to N7 and P0 to P2 apply to both directions of transmission,  whilst  a  separate
  954.          set of C1, C2, C3 variables must be provided in the encoder and decoder.
  955.                N1  Maximum codeword size (bits);
  956.                N2  Total number of codewords;
  957.                N3  Character size (bits):
  958.                       N3 = 8;
  959.                N4  Number of characters in the alphabet:
  960.                       eq N\s\do5(4) = 2\s\up5(N3);
  961.                N5  index number of first dictionary entry used to store a string:
  962.                       N5 = N4 + N6;
  963.                N6  Number of control codewords:
  964.                       N6 = 3;
  965.                N7  Maximum string length;
  966.                C1  Next empty dictionary entry;
  967.                C2  Current codeword size;
  968.                C3  Threshold for codeword size change;
  969.                P0  V.42 bis data compression request;
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.          PAGE6   Recommendation V.42 bis
  1009.                  P1  Number of codewords (negotiation parameter);
  1010.                  P2  Maximum string size (negotiation parameter).
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.                                                             Recommendation V.42 bis   PAGE7
  1081.                                                     ANNEX A
  1082.                                      (to Recommendation V.42 bis)
  1083.                     Procedures for negotiating V.42 bis when used with V.42
  1084.                 When using this data compression Recommendation with  V.42  error  control,
  1085.           the XID negotiation procedure shall be used (see SS 7.6, 8.10, 10  of  Rec.  V.42
  1086.           and ISO 8885 - 1987 [6, 7].) A data link layer  subfield  in  addition  to  those
  1087.           defined in Recommendation V.42 shall be used for this purpose. It shall appear in
  1088.           the XID frame immediately before the user data subfield and shall be  encoded  as
  1089.           in Table A-1/V.42 bis.
  1090.                 During the protocol establishment phase, the presence of  parameter  P0  in
  1091.           the Private Parameter Set Data  Link  Layer  Subfield  of  the  XID  frame  shall
  1092.           indicate a request for data compression.
  1093.                 Note  -  The  incorporation  of   the   contents   of   this   Annex   into
  1094.           Recommendation V.42 is under consideration by Study Group XVII.
  1095.                                                TABLE 1/V.42 bis
  1096.                                           Bit       
  1097.                                        8 . . . 1    
  1098.           Group ID                   11110000        Private parameter ser
  1099.                                                             (ISO 8885, Addendum 3)
  1100.           Group Length               nnnnnnnn        (MSB) Length of parameter field
  1101.                                                      (excludes group ID and length)
  1102.                                      nnnnnnnn        (LSB)
  1103.           Parameter ID               00000000        Parameter set identifier
  1104.           Parameter length           00000011        Length of string
  1105.           Parameter value            01010110        V
  1106.                                      00110100        4
  1107.                                      00110010        2
  1108.           Parameter ID               00000001        Rec. V.42 bis - Data Compression
  1109.                                                      request (P0)
  1110.           Parameter length           00000001        Length of field
  1111.           Parameter value            000000nn        Request for compression in:
  1112.                                                      00  neither direction
  1113.                                                      01  negotiation initiator-responder
  1114.                                                            direction only
  1115.                                                      10  negotiation responder-initiator
  1116.                                                            direction only
  1117.                                                      11  both directions
  1118.                                                      
  1119.           Parameter ID               00000010        Rec.V.42 bis - Number of codewords 
  1120.           Parameter length           00000010        (P1)
  1121.           Parameter value            nnnnnnnn        16-bit integer
  1122.                                      nnnnnnnn        (MSB) Value of parameter P1
  1123.           Parameter ID               00000011        (LSB)
  1124.           Parameter length           00000001        Rec. V.42 bis - Maximum string length 
  1125.           Parameter value            nnnnnnnn        (P2)
  1126.                                                      8-bit integer
  1127.                                                      Value of parameter P2
  1128.                                                     MSB:Most significant bit
  1129.               LSB:   Least significant bit
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.           PAGE6   Recommendation V.42 bis
  1153.                                                  APPENDIX I
  1154.                                     (to Recommendation V.42 bis)
  1155.                       SDL description of encoder (Z.100 to Z.104) [8]
  1156.                Figure I-1/V.42 bis shows the set of SDL symbols used in  the  diagrams  of
  1157.          this Appendix.
  1158.                The following diagrams provide an illustration  of  the  operation  of  the
  1159.          encoder:
  1160.                a)  Figure I-2/V.42 bis: Encoder (see SS 7.2, 7.3, 7.8, 7.9). This diagram
  1161.                   illustrates the operation of the main elements of the encoder.
  1162.                b)  Figure I-3/V.42 bis: Process of character (see SS 6.3, 6.4, 6.5). This
  1163.                   diagram illustrates the operation of the string matching procedure, the
  1164.                   conditions under which it is terminated and the action taken.
  1165.                c)  Figure I-4/V.42 bis: Check codeword size (see  S  7.4).  This  diagram
  1166.                   illustrates the codeword size step up mechanism.
  1167.                d)  Figure I-5/V.42 bis:  Test  compression  (see  S  7.8).  This  diagram
  1168.                   illustrates  the  procedures  for  changing  between  transparent   and
  1169.                   compressed modes of operation and for use of RESET.
  1170.                e)  Figure I-6/V.42 bis: Flush (see S 7.9). This diagram  illustrates  the
  1171.                   action taken on receipt of a C-FLUSH request.
  1172.                f)  Figure I-7/V.42 bis: Exception process next character (see SS 7.8.1 a,
  1173.                   7.8.2 b, 7.9 b). This  diagram  illustrates  the  means  by  which  the
  1174.                   compressed  mode  character  processing  is   performed   following   a
  1175.                   transition to compressed mode or a flush operation.
  1176.                g)  Figure I-8/V.42 bis: Escape character procedure (see S 9.2).
  1177.                h)  Figure I-9/V.42 bis: Signal reset procedure (S 7.8.3).
  1178.                i)  Figure I-10/V.42 bis: Add string + character to  dictionary  procedure
  1179.                   (SS 6.4 and 6.5).
  1180.  
  1181.                                              FIGURE I-1/V.42 bis
  1182.                                               SDL Symbols used
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.                                                            Recommendation V.42 bis   PAGE7
  1225.  
  1226.                                              FIGURE I-2/V.42 bis
  1227.                                                    Encoder
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.          PAGE6   Recommendation V.42 bis
  1297.  
  1298.                                              FIGURE I-3/V.42 bis
  1299.                                          Process character procedure
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.                                                            Recommendation V.42 bis   PAGE7
  1369.  
  1370.                                              FIGURE I-4/V.42 bis
  1371.                                         Check codeword size procedure
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.          PAGE6   Recommendation V.42 bis
  1441.  
  1442.                                              FIGURE I-5/V.45 bis
  1443.                                          Test compression procedure
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.                                                            Recommendation V.42 bis   PAGE7
  1513.  
  1514.                                              FIGURE I-6/V.42 bis
  1515.                                                Flush procedure
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.          PAGE6   Recommendation V.42 bis
  1585.  
  1586.                                              FIGURE I-7/V.42 bis
  1587.                                  Exception process next character procedure
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.                                                            Recommendation V.42 bis   PAGE7
  1657.  
  1658.                                              FIGURE I-8/V.42 bis
  1659.                                          Escape character procedure
  1660.  
  1661.  
  1662.                                              FIGURE I-9/V.42 bis
  1663.                                           Signal "Reset" procedure
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.          PAGE6   Recommendation V.42 bis
  1729.  
  1730.                                              FIGURE I-10/V.42 bis
  1731.                                Add "string + character" to dictionary procedure
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.                                                             Recommendation V.42 bis   PAGE7
  1801.                                                  APPENDIX II
  1802.                                     (to Recommendation V.42 bis)
  1803.                                 Guidance for implementors
  1804.                The following notes provide information on the implementation of  the  data
  1805.          compression scheme and on the selection of parameters.
  1806.          II.1   Selection of N2, the total number of codewords
  1807.                The dictionary size is equal to N2 - N6  (assuming  that  entries  are  not
  1808.          provided for the reserved codewords). The selection of a large value for N2 means
  1809.          that the number of strings available is large, but also that the value of  N1  is
  1810.          larger. The  gain  in  performance  obtained  from  the  selection  of  a  larger
  1811.          dictionary may be offset by the larger codeword  size  needed,  and  for  certain
  1812.          types of data, better performance may be obtained by using a smaller  dictionary.
  1813.          If values of N2 in the range 2n + 1 (for integer n) to approximately 1.3 X 2n are
  1814.          selected, no performance improvement will be gained over  the  selection  of  the
  1815.          value 2n. A value for N2 of 2048 provides good compression performance  across  a
  1816.          wide range of data types.
  1817.          II.2   Data structures
  1818.                The data compression  scheme  described  in  this  Recommendation  is  well
  1819.          suited to implementation using a tree based data structure.  This  type  of  data
  1820.          structure will provide good utilization of memory space and fast searching.
  1821.          II.3   Calculation of compression performance
  1822.                The calculation of compression performance may be expressed as  the  number
  1823.          of characters received by an encoder divided by the number of octets  transferred
  1824.          from the encoder (to the error control function). The  count  of  characters  and
  1825.          octets should be set to zero on receipt of a C-INIT request.
  1826.          II.4   Examples of the operation of the encoder
  1827.                The following three examples illustrate the operation of  the  encoder.  It
  1828.          is assumed that the dictionary is in the state shown in Figure 2.V.42 bis.
  1829.          II.4.1 Simple case: "BAY", compressed mode
  1830.                The first character "B" is  read,  and  the  dictionary  searched  for  the
  1831.          string "B". As this string is  present,  the  next  character  "A"  is  read  and
  1832.          appended, forming the new string "BA". The dictionary is  searched  for  the  new
  1833.          string and when it is found, the next character "Y" is read and appended, forming
  1834.          the new string "BAY". The dictionary is searched for "BAY", which is not present.
  1835.          "Y" is removed, and the string matching procedure exits with "BA" as the  matched
  1836.          string and "Y" as the unmatched character.
  1837.                The codeword for "BA" is encoded  in  C2  bits,  packed  into  octets,  and
  1838.          passed to the control function for transmission. The new string "BAY" is  created
  1839.          by appending "Y" to "BA", assigning the  codeword  with  value  C1  to  this  new
  1840.          string. C1 is incremented, and the node (string) currently assigned this value is
  1841.          tested to see if it is empty or is a leaf node. If the node is empty, it will  be
  1842.          used in the next dictionary update. If the node is used and is not a  leaf  node,
  1843.          i.e. is part of a longer string, then  C1  is  incremented  again  and  the  test
  1844.          repeated. If the node is a leaf node, then it is detached  from  its  parent  and
  1845.          will be re-used in the next dictionary update.
  1846.                The character "Y" will be used to restart the string match.
  1847.          II.4.2 Simple case: "BAY", transparent mode
  1848.                In transparent mode, the same sequence of operation described in  S  II.4.1
  1849.          will occur, the only difference being  that  the  characters  "A",  "Y"  will  be
  1850.          transmitted in place of the codeword for "BA".
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.          PAGE6   Recommendation V.42 bis
  1873.                II.4.3 Repeated characters or sequences: "CCCCC", compressed mode
  1874.                The aim of this example  is  to  illustrate  a  particular  aspect  of  the
  1875.          algorithm. As the encoder is able to update its dictionary on the basis  f  look-
  1876.          ahead, whilst the decoder is only able to update its dictionary on the  basis  of
  1877.          previously decoded data, it is necessary to ensure that the encoder does not  use
  1878.          new dictionary entries before they are transmitted to the decoder.
  1879.                The first "C" is read and will be matched with  the  dictionary  entry  for
  1880.          "C". The second "C" is read, appended to the first, and the  dictionary  searched
  1881.          for "CC". As "CC" is not in the dictionary, the string matching  procedure  exits
  1882.          with the matched string as "C" and the unmatched character as "C". "CC" is  added
  1883.          to the dictionary, the codeword for "C" sent, and string matching  restarts  with
  1884.          the second "C".
  1885.                The third "C" is read, appended to the second "C", forming  "CC",  and  the
  1886.          dictionary searched for "CC". As this is in the dictionary but is,  however,  the
  1887.          entry created since the last string match, [see S 6.3 b)],  the  string  matching
  1888.          procedure exits with the matched string as "C" and  the  unmatched  character  as
  1889.          "C". "CC" is not added to the dictionary as it is already present,  the  codeword
  1890.          for "C" sent, and string matching starts with the third "C".
  1891.                The fourth "C" is read, appended to the third "C", forming  "CC",  and  the
  1892.          dictionary searched for "CC" As "CC" is found in the dictionary, and it does  not
  1893.          match the entry created since the last string match  (the  update  operation  was
  1894.          inhibited), the fifth "C" is read and appended to the string.
  1895.          References
  1896.          [1]     CCITT  Recommendation  Error  Correcting  Procedures   for   DCEs   using
  1897.                Asynchronous-to-Synchronous Conversion, Vol. VIII, Rec. V.42.
  1898.          [2]    CCITT Recommendation Support by a ISDN of Data Terminal Equipment with  V-
  1899.                Series Type Interfaces with Provision for Statistical  Multiplexing,  Vol.
  1900.                VIII, Rec. V.120.
  1901.          [3]    ISO 3309 - Data Communication - High Level Data Link Control Procedures  -
  1902.                Frame Structure.
  1903.          [4]    CCITT Recommendation Definitions of terms  concerning  data  communication
  1904.                over the telephone network, Vol. VIII, Rec. V.7.
  1905.          [5]     CCITT  Recommendation  Transmission  of  Start   Stop   Characters   over
  1906.                Synchronous Bearer Channels, Vol. VIII, Rec. V.14.
  1907.          [6]    ISO 8885 - 1987 Information Processing Systems  -  Data  Communications  -
  1908.                High Level Data Link  Control  Procedures  -  General  Purpose  XID  Frame
  1909.                Information Field Content and Format.
  1910.          [7]    ISO 8885 - 1987/ADD3 Information Processing Systems - Data  Communications
  1911.                - High Level Data Link Control Procedures  -  General  Purpose  XID  Frame
  1912.                Information Field Content and Format - Addendum 3: Definition of a private
  1913.                parameter data link layer subfield.
  1914.          [8]    Serie Z.100 CCITT Recommendations Functional Specification and Description
  1915.                Language (SDL), Vol. X.
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.                                                            Recommendation V.42 bis   PAGE7
  1945.